package com.bjpowernode.javase.annotation8;

public class Test2 {
    public static void main(String[] args) {
        Class<Test1> test1Class = Test1.class;
        if (test1Class.isAnnotationPresent(MyAnnotation.class)){
            System.out.println(test1Class.getAnnotation(MyAnnotation.class));
            MyAnnotation myAnnotation = test1Class.getAnnotation(MyAnnotation.class);
            String key = myAnnotation.key();
            System.out.println(key);
        }
        System.out.println("====================");
    }
}
